package com.jdz.gxq.info.admin.smallloan.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.jdz.gxq.info.admin.smallloan.bo.Smallloan;
import com.jdz.gxq.info.admin.smallloan.form.EditSmallloanForm;
import com.jdz.gxq.info.admin.smallloan.service.SmallloanService;
import com.jdz.gxq.info.common.action.CommonAction;

public class EditSmallloanAction extends CommonAction {

	private SmallloanService smallloanService = null;
	 
	public ActionForward doExecute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws java.lang.Exception {
		
		EditSmallloanForm editSmallloanForm = (EditSmallloanForm) form;
	
		Smallloan smallloan = smallloanService.getSmallloanById(editSmallloanForm.getId());
		
		editSmallloanForm.setSmallloan(smallloan);

		return mapping.findForward("success");
	}

	public void setSmallloanService(SmallloanService smallloanService) {
		this.smallloanService = smallloanService;
	}
}

